<?php

/**
 * Description of AbstractValidateFactory
 *
 * @author BUI TIEN HIEP
 * @email bthiep@lhv.vn
 */
abstract  class AbstractValidateFactory {

    protected $message;//Policy Violations message
    protected $policy;//Policy
    public abstract function  validate($expenses = array());

    /**
     * Equal condition
     * @param type $field
     * @param type $value
     * @return \FieldEqualSpecification
     */
    public function isEqual($field, $value) {
        return new FieldEqualSpecification($field, $value);
    }
    /**
     * Not Equal condition
     * @param type $field
     * @param type $value
     * @return \FieldNotEqualSpecification
     */
    public function isNotEqual($field, $value){
        return new FieldNotEqualSpecification($field, $value);
    }

    /**
     * Greater than condition
     * @param type $field
     * @param type $value
     * @return \FieldGreaterThanSpecification
     */
    public function isGreaterThan($field,$value){
        return new FieldGreaterThanSpecification($field, $value);
    }
    /**
     * Less than condition
     * @param type $field
     * @param type $value
     * @return \FieldLessThanSpecification
     */
    public function isLessThan($field,$value)
    {
        return new FieldLessThanSpecification($field, $value);
    }
    /**
     * LIKE condition
     * @param type $field
     * @param type $findString
     * @return \FieldContainSpecification
     */
    public function isContain($field,$findString)
    {
        return new FieldContainSpecification($field, $findString);
    }
        /**
     * NOT LIKE condition
     * @param type $field
     * @param type $findString
     * @return \FieldNotContainSpecification
     */
    public function isNotContain($field,$findString)
    {
        return new FieldNotContainSpecification($field, $findString);
    }
    public function getMessage()
    {
        return $this->message;
    }
}
